package cn.chaohi.common.domain.award.model;

import java.io.Serializable;

import cn.chaohi.utils.ConfigUtils;
import cn.chaohi.utils.DESUtils;

/**
 * 加密请求返回数据
 * 
 * @author bobo
 *
 */
public class Des3CBCReq implements Serializable {

	/**
	 * 序列化
	 */
	private static final long serialVersionUID = 1L;

	/**
	 * 加密请求数据
	 */
	private String xy = "";

	/**
	 * 向量
	 */
	private String iv = "";

	/**
	 * 加密处理
	 * @param resJson 返回数据
	 * @throws Exception
	 */
	public Des3CBCReq(String resJson) throws Exception {
		String key = ConfigUtils.getValue("applet.api.key");
		this.iv = DESUtils.generateShort8Uuid();
		this.xy = DESUtils.des3EncodeCBC(key, resJson, iv);
	}

	public String getXy() {
		return xy;
	}

	public void setXy(String xy) {
		this.xy = xy;
	}

	public String getIv() {
		return iv;
	}

	public void setIv(String iv) {
		this.iv = iv;
	}

	@Override
	public String toString() {
		return "Des3CBCReq [xy=" + xy + ", iv=" + iv + "]";
	}

	
}
